import axios from '@/utils/request'

// 获得推荐一列的标题数据 我的频道
export const getUserChannels = () =>
  axios({
    url: '/v1_0/user/channels'
  })

// 获取所有频道

export const getAllChannels = () =>
  axios({
    method: 'get',
    url: '/v1_0/channels'
  })

// 已登录时发起请求存储数据

export const setUserChannels = (channels) =>
  axios({
    method: 'PATCH',
    url: '/v1_0/user/channels',
    data: {
      channels
    }
  })

// 删除频道，提供接口
export function delUserChannels(target) {
  return axios({
    method: 'DELETE',
    // target  需要删除的用户频道id
    url: '/v1_0/user/channels/' + target
  })
}
